import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/pages/notice/model/notice_model_entity.dart';

NoticeModelEntity $NoticeModelEntityFromJson(Map<String, dynamic> json) {
  final NoticeModelEntity noticeModelEntity = NoticeModelEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    noticeModelEntity.id = id;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    noticeModelEntity.title = title;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    noticeModelEntity.content = content;
  }
  final String? pushTime = jsonConvert.convert<String>(json['pushTime']);
  if (pushTime != null) {
    noticeModelEntity.pushTime = pushTime;
  }
  final dynamic cd = json['cd'];
  if (cd != null) {
    noticeModelEntity.cd = cd;
  }
  final dynamic status = json['status'];
  if (status != null) {
    noticeModelEntity.status = status;
  }
  return noticeModelEntity;
}

Map<String, dynamic> $NoticeModelEntityToJson(NoticeModelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['title'] = entity.title;
  data['content'] = entity.content;
  data['pushTime'] = entity.pushTime;
  data['cd'] = entity.cd;
  data['status'] = entity.status;
  return data;
}

extension NoticeModelEntityExtension on NoticeModelEntity {
  NoticeModelEntity copyWith({
    int? id,
    String? title,
    String? content,
    String? pushTime,
    dynamic cd,
    dynamic status,
  }) {
    return NoticeModelEntity()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..content = content ?? this.content
      ..pushTime = pushTime ?? this.pushTime
      ..cd = cd ?? this.cd
      ..status = status ?? this.status;
  }
}
